home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / OLE2BOOK.ZIP / CHAP06.ZIP / CHAP06 / FREELOAD / MAKEFILE < prev    next >
Text File  |  1993-06-22  |  3KB  |  132 lines

  1. #
  2. # MAKEFILE
  3. # Freeloader Chapter 6
  4. #
  5. # Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  6. #
  7. # Kraig Brockschmidt, Software Design Engineer
  8. # Microsoft Systems Developer Relations
  9. #
  10. # Internet  :  kraigb@microsoft.com
  11. # Compuserve:  >INTERNET:kraigb@microsoft.com
  12. #
  13.  
  14. #Add '#' to the next line for 'noisy' operation
  15. !CMDSWITCHES +s
  16.  
  17. #
  18. #Compiler flags
  19. #Use "SET RETAIL=1" from MS-DOS to compile non-debug version.
  20. #
  21. !ifndef RETAIL
  22. CFLAGS  = -c -nologo -Od -AM -Zipe -G2s -W3 -GA -GEs
  23. LINK    = /al:16/ONERROR:NOEXE/CO
  24. DEFS    = -DSTRICT -DDEBUG
  25. !else
  26. CFLAGS  = -c -nologo -Oas -AM -Zpe -G2s -W3 -GA -GEs
  27. LINK    = /al:16/ONERROR:NOEXE
  28. DEFS    = -DSTRICT
  29. !endif
  30.  
  31.  
  32. !ifdef SDI
  33. DOC     = -DSDI
  34. CLASSLIB= classSDI
  35. DIR     = SDI
  36. SRC_DIR = ..
  37. !else
  38. DOC     = -DMDI
  39. CLASSLIB= classMDI
  40. DIR     = MDI
  41. SRC_DIR = ..
  42. !endif
  43.  
  44.  
  45. .SUFFIXES: .h .obj .exe .cpp .res .rc
  46.  
  47. TARGET  = freeload
  48.  
  49. goal:   cd_build precomp.pch $(TARGET).exe cd_src
  50.  
  51. cd_build:
  52.     cd $(DIR)
  53.  
  54. cd_src:
  55.     cd ..
  56.  
  57.  
  58. clean:
  59.     cd $(DIR)
  60.     del *.pch
  61.     del *.obj
  62.     del *.res
  63.     del *.exe
  64.     cd ..
  65.  
  66.  
  67. PCHFLAGS= -Yu$(TARGET).h -Fpprecomp.pch
  68.  
  69. INCLS    = $(SRC_DIR)\$(TARGET).h
  70. OLELIBS  = compobj storage ole2
  71. LIBS     = libw mlibcew commdlg bttncur gizmobar stastrip $(CLASSLIB)
  72.  
  73. OBJS1    = $(TARGET).obj client.obj document.obj
  74. OBJS     = $(OBJS1)
  75.  
  76.  
  77. RCFILES1 = $(SRC_DIR)\app.ico $(SRC_DIR)\document.ico $(SRC_DIR)\about.dlg
  78. RCFILES2 = $(SRC_DIR)\stdgz72.bmp $(SRC_DIR)\stdgz96.bmp $(SRC_DIR)\stdgz120.bmp
  79. RCFILES  = $(RCFILES1) $(RCFILES2)
  80.  
  81.  
  82.  
  83. #####
  84.  
  85. {$(SRC_DIR)}.cpp{}.obj:
  86.     echo ++++++++++
  87.     echo Compiling $*.cpp
  88.     cl $(CFLAGS) $(PCHFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  89.  
  90.  
  91. {$(SRC_DIR)}.rc{}.res:
  92.     echo +++++++++
  93.     echo Compiling Resources
  94.     rc -r -i$(SRC_DIR) $(DEFS) $(DOC) -fo$@ $(SRC_DIR)\$*.rc
  95.  
  96. precomp.pch : $(SRC_DIR)\$(TARGET).h
  97.     echo +++++++++
  98.     echo Precompiling $(TARGET).h
  99.     cl $(CFLAGS) $(DEFS) -Yc$(TARGET).h -Fpprecomp.pch -Foprecomp $(SRC_DIR)\precomp.cpp
  100.  
  101.  
  102. #This rule builds a linker response file on the fly depending on debug flags
  103. $(TARGET).exe : $(OBJS) $(TARGET).res $(SRC_DIR)\$(TARGET).def
  104.     echo ++++++++++
  105.     echo Linking $@
  106.     echo precomp +                               > $(TARGET).lrf
  107.     echo $(OBJS1)                               >> $(TARGET).lrf
  108.  
  109.     echo $(TARGET).exe $(LINK)                  >> $(TARGET).lrf
  110.     echo nul/li                                 >> $(TARGET).lrf
  111.     echo $(OLELIBS) +                           >> $(TARGET).lrf
  112.     echo $(LIBS) /NOD/NOE                       >> $(TARGET).lrf
  113.     echo $(SRC_DIR)\$(TARGET).def               >> $(TARGET).lrf
  114.  
  115.     link @$(TARGET).lrf
  116.     del $(TARGET).lrf
  117.     rc -v $(TARGET).res $(TARGET).exe
  118.  
  119.  
  120. ##### Dependencies #####
  121.  
  122. $(TARGET).res : $(SRC_DIR)\$(TARGET).rc $(INCLS) $(RCFILES)
  123.  
  124. $(TARGET).obj : $(SRC_DIR)\$(TARGET).cpp    $(INCLS)
  125.     echo ++++++++++
  126.     echo Compiling $*.cpp
  127.     cl $(CFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  128.  
  129.  
  130. client.obj    : $(SRC_DIR)\client.cpp    $(INCLS)
  131. document.obj  : $(SRC_DIR)\document.cpp  $(INCLS)
  132.